import request from './config'

export default {
  batchDeleteOrder (data) {
    return request({
      data,
      url: '/batchDeleteOrder'
    })
  },
  /**
   * 获取订单列表
   * @Author   chend
   * @DateTime 2019-10-17T11:30:51+0800
   * @param    {Object}                 paramsTmp 筛选条件
   */
  getOrderList (paramsTmp) {
    var params = {}
    Object.entries(paramsTmp).forEach(v => {
      console.log(paramsTmp, 'getOrderList', v)
      if (v[1]) {
        params[v[0]] = v[1]
      }
    })
    return request({data: params, url: 'getOrderList'})
  },
  /**
   * 根据openid获取订单信息
   * @Author   chend
   * @DateTime 2019-10-17T11:31:57+0800
   * @param    {String}                 options.openid 订单id
   */
  getOrderListByOpenId ({openid}) {
    return request({data: {openid}, url: 'getOrderListByOpenId'})
  },
  /**
   * 根据openid获取订单统计
   * @Author   chend
   * @DateTime 2019-10-17T11:31:57+0800
   * @param    {String}                 options.openid 订单id
   */
  getOrderTjByOpenId ({openid}) {
    return request({data: {openid}, url: 'getOrderTjByOpenId'})
  }
}
